package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * OrdersEquipments generated by hbm2java
 */
@Entity
@Table(name = "ORDERS_EQUIPMENTS", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = {
		"ORDERS_ID", "EQUIPMENT_ID", "PRICE", "QUANTITY" }))
public class OrdersEquipments implements java.io.Serializable {

	private OrdersEquipmentsId id;
	private Orders orders;
	private Equipments equipments;

	public OrdersEquipments() {
	}

	public OrdersEquipments(OrdersEquipmentsId id, Orders orders,
			Equipments equipments) {
		this.id = id;
		this.orders = orders;
		this.equipments = equipments;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "ordersId", column = @Column(name = "ORDERS_ID", nullable = false)),
			@AttributeOverride(name = "equipmentId", column = @Column(name = "EQUIPMENT_ID", nullable = false)),
			@AttributeOverride(name = "price", column = @Column(name = "PRICE", nullable = false, precision = 128, scale = 0)),
			@AttributeOverride(name = "quantity", column = @Column(name = "QUANTITY", nullable = false)),
			@AttributeOverride(name = "total", column = @Column(name = "TOTAL", nullable = false, precision = 128, scale = 0)) })
	public OrdersEquipmentsId getId() {
		return this.id;
	}

	public void setId(OrdersEquipmentsId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORDERS_ID", nullable = false, insertable = false, updatable = false)
	public Orders getOrders() {
		return this.orders;
	}

	public void setOrders(Orders orders) {
		this.orders = orders;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "EQUIPMENT_ID", nullable = false, insertable = false, updatable = false)
	public Equipments getEquipments() {
		return this.equipments;
	}

	public void setEquipments(Equipments equipments) {
		this.equipments = equipments;
	}

}
